import requests
import json

# 创建会话
session = requests.Session()

BASE_URL = "http://198.10.51.2:8090/task/taskCooperation/getTrunBasicInfoUrl?pageNo=1&pageSize=5&taskId=1892739316598312960"
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer eyJhbGciOiJIUzUxMiJ9.eyJ1c2VySWQiOjE3NDYxODA2MDQwMDk4MDM3NzgsImFjY291bnQiOiJrWkVROXMzcitrNmRibENCRVZ3by9lUUxPRDVUR1hFVFlLMmtIQ3FoSzhJPSIsInV1aWQiOiI3ODVkZTcxZS1kOTNkLTQxYjItOWVlZC1mMWVhOTY5NmUwNzQiLCJzdWIiOiIxNzQ2MTgwNjA0MDA5ODAzNzc4IiwiaWF0IjoxNzQxNzY3NDg3LCJleHAiOjE3NDE4NTM4ODd9.RfWXleeHyu_oV0KKbc28zasTs5eGrACWLHu6j2L9vdtkJu2ewMIPZjy7LsDcutO4HlbNvoH_s5szTo8fVjsnKQ"
}

cookies = {
}

data = {

}

try:

    response_info = session.get(BASE_URL, headers=headers, cookies=cookies)
    response_info.raise_for_status()  # 检查响应状态码是否为 200
    #print("详情响应内容:", response_info.json())
    partiesDataText = json.loads(response_info.text)
    print("请求响应数据：",partiesDataText)
    partiesList = partiesDataText['data']['rows']
    print("写一个mysql新建表的语句，表名用为ywtg_xunhangjiancha_27_29，表字段是默认字符串，要避免 Row size too large 错误，并翻译成中文注解插入表，",tuple(partiesList[0].keys()))

except requests.exceptions.RequestException as e:
    print(f"请求失败: {e}")
    print("响应内容:", response_info.text)  # 打印原始响应内容